<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:include href="templates.xsl" />
<xsl:include href="preferences.xsl"/>
<xsl:template match="/">
   var alphaim=[ 
<xsl:for-each select="library/category[@name='Title']/index">"<xsl:value-of select="@name" />,Title_<xsl:value-of select="@name"/>_1.html,<xsl:choose><xsl:when test="@name = '09'">1</xsl:when><xsl:when test="@name = 'A'">2</xsl:when><xsl:when test="@name = 'B'">22</xsl:when><xsl:when test="@name = 'C'">222</xsl:when><xsl:when test="@name = 'D'">3</xsl:when><xsl:when test="@name = 'E'">33</xsl:when><xsl:when test="@name = 'F'">333</xsl:when><xsl:when test="@name = 'G'">4</xsl:when><xsl:when test="@name = 'H'">44</xsl:when><xsl:when test="@name = 'I'">444</xsl:when><xsl:when test="@name = 'J'">5</xsl:when><xsl:when test="@name = 'K'">55</xsl:when><xsl:when test="@name = 'L'">555</xsl:when><xsl:when test="@name = 'M'">6</xsl:when><xsl:when test="@name = 'N'">66</xsl:when><xsl:when test="@name = 'O'">666</xsl:when><xsl:when test="@name = 'P'">7</xsl:when><xsl:when test="@name = 'Q'">77</xsl:when><xsl:when test="@name = 'R'">777</xsl:when><xsl:when test="@name = 'S'">7777</xsl:when><xsl:when test="@name = 'T'">8</xsl:when><xsl:when test="@name = 'U'">88</xsl:when><xsl:when test="@name = 'V'">888</xsl:when><xsl:when test="@name = 'W'">9</xsl:when><xsl:when test="@name = 'X'">99</xsl:when><xsl:when test="@name = 'Y'">999</xsl:when><xsl:when test="@name = 'Z'">9999</xsl:when></xsl:choose>",</xsl:for-each>
];

 var genreim=[
 <xsl:for-each select="library/category[@name='Other']/index">"<xsl:value-of select="@name" />,Other_<xsl:value-of select="@name"/>_1.html,<xsl:choose><xsl:when test="@name = 'All'">255</xsl:when><xsl:when test="@name = 'HD'">43</xsl:when><xsl:when test="@name = 'TV Shows'">887</xsl:when><xsl:when test="@name = 'Movies'">668</xsl:when><xsl:when test="@name = 'Trailers'">872</xsl:when><xsl:when test="@name = 'New'">639</xsl:when><xsl:when test="@name = 'Top250'">807</xsl:when><xsl:otherwise>blank</xsl:otherwise></xsl:choose>",</xsl:for-each>
<xsl:for-each select="library/category[@name='Genres']/index">"<xsl:value-of select="@name" />,Genres_<xsl:value-of select="@name"/>_1.html,<xsl:choose><xsl:when test="@name = 'Action'">228</xsl:when><xsl:when test="@name = 'Animation'">264</xsl:when><xsl:when test="@name = 'Comedy'">266</xsl:when><xsl:when test="@name = 'Documentary'">362</xsl:when><xsl:when test="@name = 'Drama'">372</xsl:when><xsl:when test="@name = 'Fantasy'">326</xsl:when><xsl:when test="@name = 'Other'">684</xsl:when><xsl:when test="@name = 'Sci-Fi'">724</xsl:when><xsl:when test="@name = 'Thriller'">847</xsl:when><xsl:when test="@name = 'Reality'">732</xsl:when><xsl:when test="@name = 'Horror'">467</xsl:when><xsl:when test="@name = 'Family'">3264</xsl:when><xsl:when test="@name = 'Music'">687</xsl:when></xsl:choose>",</xsl:for-each>
]

var rating= [
   <xsl:for-each select="library/movies/movie[@isTrailer!='true']">"<xsl:value-of select='certification'/>"<xsl:if test="position() != last()">,</xsl:if>
   </xsl:for-each>];

var ratingnow=0;

 var allmoviebase = [
   "",
   <xsl:for-each select="movie[@isTrailer!='true']">"<xsl:value-of select='baseFilename'/>",
   </xsl:for-each>""]


</xsl:template></xsl:stylesheet>